var express = require('express')
var router = express.Router()

router.use(function timeLog(req, res, next) {
    console.log('Time: ', Date.now())
    next()
})
// define the home page route
router.get('/', function (req, res) {
    var name = req.cookies.name;
    res.send('product home page:' + name)
})
// define the about route
router.get('/edit', function (req, res) {
    res.send('About product')
})

router.post('/add', function (req, res) {

    var product_data = req.body;
    //console.log(product_data);
    res.send('product 标题' + product_data.title);
})

module.exports = router